<?php

namespace Home\Controller;
use Think\Controller;

//Controller父类：ThinkPHP/Library/Think/Controller.class.php

class UserController extends Controller{
    //用户登录
    function login(){
        //调用视图display();
        //$this->assign("aa","12323");
        //$this -> display("hello");
        $this -> display();
    }

    //用户注册
    function register(){
        $this -> display();
    }
    
    function _empty(){
        echo "<img src='".IMG_URL.'404.gif'."' alt='' />";
    }
    
    function number(){
        //模仿从数据库获得数据
        return "目前网站注册会员200万";
    }


     //验证用户的登录信息
      function dologin(){

      	$username=$_POST['username'];
      	$password=$_POST['password'];
        //验证用户是否合法
        if($username=='aa' && $password=='123456'){
              //合法
        	 $this->assign("info","1");

        	 //跳转用户信息页面
        	 $this -> display("login");
        }else{
        	 $this->assign("info","0");
        	 $this -> display("login");
        }
        
    }


}

